package com.afalon.cloud.contracts.system;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;

@XmlRootElement(name = "sencha")
@XmlAccessorType(XmlAccessType.NONE)
@XmlSeeAlso(User.class)
public class SenchaEnvelope<T> {

	@XmlElement(type = Boolean.class)
	private Boolean success;
	
	@XmlElement
	private String message;
	
	@XmlElement
	private T data;

	public SenchaEnvelope()
	{
		
	}
	
	public SenchaEnvelope(Boolean successFlag, String messageString)
	{
		success = successFlag;
		message = messageString;
	}
	
	public SenchaEnvelope(Boolean successFlag, String messageString, T dataObject)
	{
		success = successFlag;
		message = messageString;
		data = dataObject;
	}
	
	public void setSuccess(Boolean value) {
		success = value;
	}

	public Boolean getSuccess() {
		return success;
	}
	
	public void setMessage(String value) {
		message = value;
	}

	public String getMessage() {
		return message;
	}
	
	public void setData(T value) {
		data = value;
	}

	public T getData() {
		return data;
	}
	
}
